import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    showGoodItem: false,
    totalCount: 0,
    totalPrice: 0,
    selectFood: []
  },
  mutations: {
    changeShowGood(state) {
      if(state.showGoodItem) {
        state.showGoodItem = false;
      } else {
        state.showGoodItem = true;
      }
    }, 
    setTotalCount(state, newCount) {
      state.totalCount = newCount;
    },
    setTotalPrice(state, newPrice) {
      state.totalPrice = newPrice;
    },
    setSelectFood(state, newFood) {
      state.selectFood = newFood;
    }
  },
})